//
//  DownloadOpCell.swift
//  GhostWorld
//
//  Created by Kam on 2018/5/29.
//  Copyright © 2018 LKGood. All rights reserved.
//

import UIKit

protocol DownloadOpCellDelegate {
  func addToPlaylist()
  func downloadAllAudios()
  func sortAudios()
}

class DownloadOpCell: UITableViewCell {

  // MARK: - IBOutlets
  
  @IBOutlet private weak var downloadAllButton: UIButton!
  
  
  // MARK: - Private vars
  
  
  
  // MARK: - Private methods
  
  private var isDisplayingUnDownloadedAudios = false
  
  // MARK: - Public vars
  
  var isDownloadAllButtonHidden: Bool = false {
    didSet {
      downloadAllButton.isHidden = isDownloadAllButtonHidden
    }
  }
  
  var delegate: DownloadOpCellDelegate?
  
  // MARK: - Lifecycle
  
  override func awakeFromNib() {
    super.awakeFromNib()
    // Initialization code
  }
  
  override func setSelected(_ selected: Bool, animated: Bool) {
    super.setSelected(selected, animated: animated)
    
    // Configure the view for the selected state
  }
  
  // MARK: - IBActions
  
  @IBAction func addToList() {
    delegate?.addToPlaylist()
  }
  
  @IBAction func downloadAll() {
    delegate?.downloadAllAudios()
  }
  
  @IBAction func sortAudios() {
    delegate?.sortAudios()
  }
}

extension DownloadOpCell {
  static let defaultHeight: CGFloat = 44
}
